*********************************************************************************
*Stata Dofile for "The multi-agencies dilemma of delegation: Why do policymakers*
*choose one or multiple agencies for financial regulation?"						*
*********************************************************************************

clear

use "c:\replication\replication file", replace

***fig1
firthlogit bank uncertainty lvaw_garriga logchecks cbba fsr KOFEcGI

coefplot, drop(_cons) xline(0) levels(95 90) ciopts(recast(. rcap)) /*
*/ rescale(uncertainty=3.820  lvaw_garriga=.72 logchecks=1.25 cbba=.7 fsr=.83 KOFEcGI=69.05) /*
*/ scheme(s1mono) name(Figure1, replace)


***fig2

*panel 1
firthlogit bank uncertainty lvaw_garriga logchecks cbba fsr KOFEcGI

margins, at(uncertainty=(0(1)15)) expression(invlogit(predict(xb))) cont level(95)

marginsplot, recast(line) ci1opts(fintensity(30)) recastci(rarea) /*
*/ scheme(s1mono) ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1) xline(.28, lpat(dash)) /*
*/ xline(7.36, lpat(dash)) xline(3.82) xtitle(Uncertainty) ytitle(Predicetd probability) /*
*/ title("") name(Figure2a, replace)

*panel 2
firthlogit bank uncertainty  logchecks lvaw_garriga cbba fsr KOFEcGI

margins, at(lvaw_=(.4(.1)1)) expression(invlogit(predict(xb))) cont level(95)

marginsplot, recast(line) ci1opts(fintensity(30)) recastci(rarea) /* 
*/ scheme(s1mono) ylabel(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1) xline(.53, lpat(dash)) /*
*/ xline(.91, lpat(dash)) xline(.72) xtitle(Central Bank Independence) /*
*/ ytitle(Predicetd probability) title("") name(Figure2b, replace)

graph combine Figure2a Figure2b


***regression tables

firthlogit bank uncertainty lvaw_garriga logchecks cbba fsr KOFEcGI
estimates store pml

logit bank uncertainty lvaw_garriga logchecks cbba fsr KOFEcGI
estimates store ml

ologit cont uncertainty lvaw_garriga logchecks cbba fsr KOFEcGI
estimates store ordinal

firthlogit bank hr lvaw_garriga logchecks cbba fsr KOFEcGI
estimates store pml2

esttab pml ml ordinal pml2, se aic bic obslast star(* 0.1 ** 0.05 ** 0.01) b(%9.3f) /*
*/ replace label mtitles("Firth's logit" "Standard logit" "Ordinal logit" "Firth's logit with HR")

